import request from '@/utils/request_1'

// 新增库存
export const addStorage = (params: any) =>
  request({
    url: '/stock',
    method: 'post',
    data: { ...params }
  })

// 修改库存
export const updateStorage = (params: any) =>
  request({
    url: '/stock',
    method: 'put',
    data: { ...params }
  })

// 删除库存
export const deleteStorage = (params: any) =>
  request({
    url: '/stock',
    method: 'delete',
    params
  })

// 查询全部库存
export const getAllStorage = (params: any) =>
  request({
    url: '/stock/list',
    method: 'get',
    params
  })

// 分页查询库存
export const getStoragePaging = (params: any) =>
  request({
    url: '/stock/page',
    method: 'get',
    params
  })

// 分页查询明细库存
export const getStorageDetailPaging = (params: any) =>
  request({
    url: '/stock/pageDetail',
    method: 'get',
    params
  })

// 查询库存
export const getStorage = (id: number) =>
  request({
    url: `/stock/${id}`,
    method: 'get'
  })
